package com.kawa.kemanage.mapper;

import com.kawa.kemanage.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

@Mapper
public interface UserMapper {
    User findByUserName(@Param("userName") String userName);

    /**
     * 根据名字和用户类型查询所有用户
     * @return
     */
    List<User> findAllUsers(@Param("userName") String userName,@Param("userType") Integer userType);

    /**
     * 根据id查询用户
     * @param id
     * @return
     */
    User findUserById(@Param("id") Integer id);

    /**
     * 修改用户
     * @param user
     * @return
     */

    int updateUserById(User user);

    /**
     * 根据id删除用户
     * @param id
     * @return
     */
    int deleteUserById(@Param("id") Integer id);


    /**
     * 新增用户
     * @param user
     * @return
     */
    int insertUser(User user);

}
